package com.ydd.mapper;

import com.ydd.dto.YddAdvAddDTO;
import com.ydd.dto.YddAdvDTO;
import com.ydd.entity.YddAdvimg;
import com.ydd.entity.YddAdvpos;
import com.ydd.vo.YddAdvimgAdvposVO;
import com.ydd.vo.YddAdvposAllVO;
import com.ydd.vo.YddAdvposRowInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (YddAdvpos)表数据库访问层
 *
 * @author makejava
 * @since 2023-04-29 12:08:38
 */
@Mapper
public interface YddAdvposMapper {


    @Select("select count(*) from ydd_advpos")
    Integer gettotalNumber();

    /**
     * 广告位动态分页查询
     *
     * @return
     */
    List<YddAdvimgAdvposVO> findByAdvpos(String advposdesc, String advposname);


    /**
     * 修改广告位
     *
     * @param yddAdvDTO
     * @return
     */
    void updateAdvpos(YddAdvDTO yddAdvDTO);

    /**
     * get广告位详情
     * @param id
     * @return
     */
    @Select("select * from ydd_advpos where id=#{id}")
    YddAdvposRowInfoVO rowInfoAdvpos(String id);

    /**
     * 根据ID删除数据
     * @param id
     * @return
     */
    void delAdvpos(String id);

    /**
     * 查询所有广告位
     *
     * @return
     */
    @Select("select advposname,advposdesc,advpossize from ydd_advpos")
    YddAdvposAllVO selectAll();

    void addAdvpos(YddAdvpos yddAdvpos);

    @Select("select advposname from ydd_advpos where id=#{advimgpos}")
    String selectAdvposname(String advimgpos);
}

